import {
  createComponentStyleSchema,
  createBizStyleSchema,
  createDecoratorStyleSchema,
  createInbizSchema,
} from '@inbiz/setters';
/**
 * 1.属性的默认值:defaultProps
 * 2.属性的json数据
 * */

export const defaultProps = {
  disposition: '欢迎使用inbiz HTML组件',
  headerStyle: {
    icon: {
      type: 'icon-html',
    },
  },
  style: {
    padding: '0px 20px 0px 20px',
  },
};

export const Html = {
  droppable: false,
  propsSchema: createInbizSchema({
    attribute: {
      base: {
        type: 'void',
        'x-component': 'CollapseItem',
        properties: {
          title: {
            type: 'object',
            'x-decorator': 'FormItem',
            'x-component': 'StatusInput',
          },
          'x-display': {
            type: 'string',
            enum: ['visible', 'hidden'],
            'x-decorator': 'FormItem',
            'x-component': 'Select',
            'x-component-props': {
              defaultValue: 'visible',
            },
          },
          'x-component-props': {
            type: 'object',
            properties: {
              disposition: {
                type: 'object',
                'x-decorator': 'FormItem',
                'x-component': 'TinymceModal',
              },
            },
          },
        },
      },
    },
    style: {
      ...createComponentStyleSchema({
        ...createBizStyleSchema(
          {
            icon: {
              type: 'string',
              'x-decorator': 'FormItem',
              'x-component': 'IconPicker',
            },
          },
          {},
        ),
      }),
      ...createDecoratorStyleSchema(),
    },
  }),
};
